<?php


class TworldCardModel extends BaseModel
{
    protected $table = 'yf_tworld_card';

    protected $principal = 'id';

    /**
     * 根据关键 获取卡信息
     * @param string $keyval
     * @return array|bool|mixed
     */
    public function findByKeyval(string $keyval)
    {
        return $this->get('*', [
            'keyval' => $keyval
        ]) ?? [];
    }

    /**
     * @return array
     */
    public function getAll():array{
        return $this->findAll(columns: ['id','name','keyval']) ?? [];
//        return $this->findAll() ?? [];
    }
}